package com.cxx.purchasecharge.dal;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.cxx.purchasecharge.core.model.GoodsIssueStatusCode;
import com.cxx.purchasecharge.core.model.persistence.GoodsIssue;
import com.cxx.purchasecharge.dal.common.GenericCRUDDao;

@Transactional
public interface GoodsIssueDao extends GenericCRUDDao <GoodsIssue, Long>, ContactDaoPlus
{
    public GoodsIssue findBySerialNumber (String serialNumber);
    
    @Query (value = "select g from GoodsIssue g where g.goods=?1")
    public List <GoodsIssue> findByGoods (long goods);
    
    @Query (value = "select g from GoodsIssue g where g.customer=?1")
    public List <GoodsIssue> findByCustomer (long customer);

    @Query (value = "select g from GoodsIssue g where g.statusCode=?1")
    public List <GoodsIssue> findByStatus (GoodsIssueStatusCode statusCode);

}
